package com.movie.app.controller;

import com.movie.app.model.Article;
import com.movie.app.model.ResponseCode;

class ArticleFilter {
    public ResponseCode addValid(Article article){
        String title = article.getTitle();
        String author = article.getAuthor();
        String url  = article.getUrl();
        String content = article.getContent();
        Object params[] = {title, author, url, content};

        ResponseCode rc = new ResponseCode();

        for (Object obj : params) {
            if (obj==null){
                rc.setCode(0);
                rc.setContent("缺少參數");
                return rc;
            }
        }
        
        rc.setCode(1);
        rc.setContent("");
        return rc;
    }
}